﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo3
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr =new int[5];
            for (int i = 0; i < 5; i++)
            {
                Console.WriteLine("请输入第{0}个数字",i+1);
                arr[i] = int.Parse(Console.ReadLine());
            }
            int position = 5;
            Console.WriteLine("请输入你要查找的数字:");
            int search = int.Parse(Console.ReadLine());
            for (int i = 0; i < 5; i++)
            {
                if (arr[i] == search) 
                {
                    position = i;
                    break;
                }

            }
            if (position < 5)
            {
                Console.WriteLine("找到了，该数字在数组的第{0}个位置", position + 1);
            }
            else {
                Console.WriteLine( "没有找到该数字！" );
            }
            Console.ReadKey();

        }
    }
}
